﻿<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>沈阳地区墒情对照图</title>

		<script type="text/javascript" src="script/jquery.min.js"></script>
		<script type="text/javascript">
		    var chart;
		    $(function () {
		        $(document).ready(function () {
		            chart = new Highcharts.Chart({
		                chart: {
		                    renderTo: 'container',
		                    defaultSeriesType: 'line'
		                },
		                title: {
		                    text: '',
		                    x: -20 //center
		                },
		                xAxis: {
		                    title: {
		                        text: '县区（点击县区可以隐藏/显示县区）',
                                style: {
                                    color: '#0066FF',
	                                fontWeight: 'bold'
                                }
		                    },
		                    categories: ['2/28', '3/3', '3/8', '3/13', '3/18', '3/23', '3/28', '4/3', '4/9']
		                },
		                yAxis: {
		                    title: {
		                        text: '土壤重量含水率（%）',
                                style: {
                                    color: '#0066FF',
	                                fontWeight: 'bold'
                                }
		                    }
                            
		                },
		                tooltip: {
		                    formatter: function () {
		                        return '<b>' + this.series.name + '</b><br/>' +
                        this.x + ': ' + this.y + '%';
		                    }
		                },
		                plotOptions: {
		                    line: {
		                        dataLabels: {
		                            enabled: false
		                        },
		                        enableMouseTracking: true
		                    }
		                },
		                series: [{
		                    name: '东陵',
		                    data: [34.1, 29, 29.8, 25.6, 28.6, 24.1, 21.2, 24.7, 24.6]
		                }, {
		                    name: '新民',
		                    data: [33, 36, 29, 32.7, 39.5, 35.6, 29.6, 26.6, 25]
		                }, {
		                    name: '辽中',
		                    data: [18.9, 20.6, 27.8, 28.1, 24.3, 20.1, 20, 18.2, 17.2]
		                }, {
		                    name: '沈北',
		                    data: [21.8, 22, 22, 37.1, 39.3, 24.7, 37.8, 20.3, 19.3]
		                }, {
		                    name: '康平',
		                    data: [14.5, 15.7, 13.4, 15.2, 21.6, 18.6, 15, 15.4, 11]
		                }, {
		                    name: '法库',
		                    data: [14.3, 15.3, 17, 17.6, 20.1, 19.4, 20.1, 20.4, 21]
		                }, {
		                    name: '苏家屯',
		                    data: [24.1, 25, 32.8, 27.2, 35.6, 28.3, 23.2, 21, 18.4]
		                }, {
		                    name: '平均',
		                    data: [23.0, 23.4, 24.5, 26.2, 29.9, 24.4, 23.8, 20.9, 19.6]
		                }]
		            });
		            //		            setData('2012');
		        });
		    });
		    //农墒2012年数据
		    var dataArray2012 = new Array();
		    dataArray2012[0] = [34.1, 29, 29.8, 25.6, 28.6, 24.1, 21.2, 24.7, 24.6];
		    dataArray2012[1] = [33, 36, 29, 32.7, 39.5, 35.6, 29.6, 26.6, 25];
		    dataArray2012[2] = [18.9, 20.6, 27.8, 28.1, 24.3, 20.1, 20, 18.2, 17.2];
		    dataArray2012[3] = [21.8, 22, 22, 37.1, 39.3, 24.7, 37.8, 20.3, 19.3];
		    dataArray2012[4] = [14.5, 15.7, 13.4, 15.2, 21.6, 18.6, 15, 15.4, 11];
		    dataArray2012[5] = [14.3, 15.3, 17, 17.6, 20.1, 19.4, 20.1, 20.4, 21];
		    dataArray2012[6] = [24.1, 25, 32.8, 27.2, 35.6, 28.3, 23.2, 21, 18.4];
		    dataArray2012[7] = [23.0, 23.4, 24.5, 26.2, 29.9, 24.4, 23.8, 20.9, 19.6];
		    dataArray2012[8] = ['2/28', '3/3', '3/8', '3/13', '3/18', '3/23', '3/28', '4/3', '4/9'];

		    //农墒2011年数据
		    var dataArray2011 = new Array();
		    dataArray2011[0] = [32.2, 29.9, 29, 30.7, 28.5, 29.1, 29.6, 29.3, 26, 26.1, 28.8, 27.2, 27.5, 26.5, 22.8, 27.4, 25.3, 25.8, 21.2];
		    dataArray2011[1] = [24.6, 30.9, 36.6, 32.1, 28.6, 24.6, 22.8, 18, 17.7, 18.1, 21.5, 21.9, 22.1, 20.5, 19.5, 19.5, 18, 18.8, 17.9];
		    dataArray2011[2] = [21.6, 22.1, 21.7, 20.8, 20.6, 19.5, 19.9, 19.2, 19, 17.8, 17.8, 20.1, 18.8, 18.7, 17.9, 17.8, 18.3, 17.4, 16.6];
		    dataArray2011[3] = [55.7, 49.7, 63.7, 62.7, 22.2, 22.2, 22.2, 22.2, 22.2, 22.2, 25.7, 22.1, 22, 21.9, 21.6, 19.4, 20.4, 21.2, 20.9];
		    dataArray2011[4] = [15.7, 16.4, 15.4, 15.9, 14.9, 14.6, 13.7, 13.7, 16, 12.2, 12, 11.9, 11, 12.2, 12, 11.5, 11.3, 11.7, 9.8];
		    dataArray2011[5] = [22.6, 22.4, 22.8, 22.2, 19.9, 19.8, 19.8, 19.8, 20.5, 21.2, 21.2, 21.3, 20.5, 20.8, 21.1, 21.6, 20.3, 18.8, 16.3];
		    dataArray2011[6] = [32.2, 32.2, 33.4, 28.5, 26.3, 27.7, 25, 24.2, 25.5, 22.4, 28.1, 29.2, 23.7, 26.1, 24.5, 24.7, 24.9, 24.7, 23.4];
		    dataArray2011[7] = [29.2, 28.7, 31.8, 30.4, 23.1, 22.5, 21.8, 20.7, 20.8, 20, 22.9, 21.9, 20.8, 20.9, 19.9, 20.3, 19.8, 19.8, 18.0];
		    dataArray2011[8] = ['2/28', '3/3', '3/8', '3/13', '3/18', '3/23', '3/28', '4/3', '4/8', '4/13', '4/18'
                                 , '4/23', '4/28', '5/3', '5/8', '5/13', '5/18', '5/23', '5/28'];

		    //农墒2010年数据
		    var dataArray2010 = new Array();
		    dataArray2010[0] = [24.8, 24.2, 28.5, 18.9, 20.7, 18.6, 21.5, 19.3, 20.3, 22.7, 19.3, 15.3, 25.7, 22.3, 32.8, 21.7, 29.8, 17.2, 20.8];
		    dataArray2010[1] = [29.2, 30.3, 36.6, 32.3, 30.4, 24.3, 23.2, 17.2, 17.7, 22, 19.1, 17.4, 18.2, 19.8, 17.8, 17.8, 18.8, 16.8, 16.5];
		    dataArray2010[2] = [19.7, 21.7, 21.6, 21.6, 19, 21.1, 19.3, 18.1, 17.6, 18.4, 18.5, 17.8, 18.4, 17.5, 18.1, 17.2, 20.4, 17.6, 17.2];
		    dataArray2010[3] = [46.9, 37.6, 40.3, 32, 36.5, 36.5, 34, 25.1, 23.2, 23, 25.6, 20.6, 25.7, 23.6, 25, 27.4, 24.4, 23.8, 23.5];
		    dataArray2010[4] = [16.4, 15.7, 14.8, 15.5, 15.4, 18.1, 15.1, 13.6, 13.5, 13.1, 16.2, 14.6, 15, 14.5, 17.7, 16, 18.6, 17.7, 15.5];
		    dataArray2010[5] = [15.1, 16.5, 20.6, 21.3, 22.5, 22.6, 20.5, 20.9, 20.7, 20.4, 22.3, 22.1, 24.1, 23.3, 27.4, 24.5, 26.9, 25.9, 24.7];
		    dataArray2010[6] = [39.6, 35.1, 41, 25.1, 38.7, 31.4, 30.1, 25.4, 23.9, 28.4, 24.9, 24, 27.7, 24.4, 28.4, 24.8, 21.8, 21.7, 20.8];
		    dataArray2010[7] = [27.4, 25.9, 29.1, 23.8, 26.2, 24.7, 23.4, 19.9, 19.6, 21.1, 20.8, 18.8, 22.1, 20.8, 23.9, 21.3, 23.0, 20.1, 19.9];
		    dataArray2010[8] = ['2/28', '3/3', '3/8', '3/13', '3/18', '3/23', '3/28', '4/3', '4/8', '4/13',
                                '4/18', '4/23', '4/28', '5/3', '5/8', '5/13', '5/18', '5/23', '5/28'];

		    //农墒2009年数据
		    var dataArray2009 = new Array();
		    dataArray2009[0] = [30.5, 28.6, 33.2, 39.6, 28.9, 26.4, 23.0, 23.2, 21.9, 19.5, 20.3, 25.6, 23.6, 25.6, 20.2, 22.1, 21.1, 22.8, 12.4, 20.9, 17.2, 23.9, 22.1];
		    dataArray2009[1] = [10, 10.8, 15.9, 14.5, 21.5, 19.4, 11.9, 12.9, 14.8, 13, 15.2, 15.6, 17.2, 16, 15.6, 15, 14.1, 13.7, 14.2, 10.9, 10.3, 13.9, 13.5];
		    dataArray2009[2] = [19, 20.5, 20.3, 19.3, 19.8, 19.6, 18.0, 18, 17.0, 16.6, 15.7, 20.6, 20.3, 19.5, 17, 18.2, 17.3, 17.8, 16.9, 12.7, 13.5, 18.7, 16];
		    dataArray2009[3] = [34.9, 43.5, 36.7, 31.5, 29.5, 25.6, 22.0, 23.1, 20.3, 18.3, 19.3, 22.8, 22.6, 22.8, 22.7, 22.5, 20.5, 21, 19, 18.6, 20.5, 20.9, 21.3];
		    dataArray2009[4] = [11, 11.6, 11.9, 13.2, 12.1, 11.1, 11.7, 10.1, 10.4, 10.6, 9, 17, 16.1, 14.3, 13.1, 14.3, 12, 11.5, 10.5, 5.3, 6.8, 7.8, 12.4];
		    dataArray2009[5] = [15.9, 15.1, 15.3, 16.4, 14.8, 13.7, 13.0, 11.8, 10.0, 10.7, 10.1, 18.2, 17.7, 18.8, 17.4, 19.3, 17.6, 17.1, 11.5, 7, 4.8, 13.5, 16.4];
		    dataArray2009[6] = [22.9, 28.9, 23.9, 27.1, 25.0, 26.4, 22.3, 23.6, 23.3, 22.4, 22.5, 23.4, 25.2, 23.3, 23.1, 25.4, 23.6, 22.6, 22.5, 21.9, 21.8, 21.4, 25];
		    dataArray2009[7] = [20.6, 22.7, 22.5, 23.1, 21.7, 20.3, 17.4, 17.5, 16.8, 15.9, 16.0, 20.5, 20.4, 20.0, 18.4, 19.5, 18.0, 18.1, 15.3, 13.9, 13.6, 17.2, 18.1];
		    dataArray2009[8] = ['2/28', '3/3', '3/8', '3/13', '3/18', '3/23', '3/28', '4/3', '4/8', '4/13',
                                 '4/18', '4/23', '4/28', '5/3', '5/8', '5/13', '5/18', '5/23', '5/28', '8/13',
                                '8/18', '8/23', '8/28'];

		    //农墒2008年数据
		    var dataArray2008 = new Array();
		    dataArray2008[0] = [18.2, 22.0, 20.6, 27.1, 22.9, 23.3, 25.6, 26.7, 23.5, 21.9, 22.4, 21.9, 21.3, 20.7, 20.9, 22.7, 21.5, 19.7, 27.6];
		    dataArray2008[1] = [10.3, 12.8, 9.6, 12.8, 12.9, 11.2, 12.3, 12.3, 10.7, 11.4, 11.3, 12.3, 11.4, 12.1, 11.2, 14.1, 12.2, 12.7, 16.4];
		    dataArray2008[2] = [17.3, 17.3, 16.1, 18.8, 16.4, 18, 18.8, 19.4, 18.3, 16.9, 16.7, 20.4, 19.8, 19.2, 17.9, 14.4, 17.3, 16.4, 20.8];
		    dataArray2008[3] = [19.9, 23.0, 19.6, 23.2, 18.8, 20.3, 25, 18.9, 18, 17, 16.3, 20.3, 19.5, 20, 18.5, 17.9, 16.9, 19.9, 20.3];
		    dataArray2008[4] = [8.5, 7.9, 8.0, 10.0, 7.0, 7.3, 11.6, 11.3, 8.5, 8.5, 8.4, 15.0, 12.5, 15.1, 14.4, 15.4, 14.7, 13.4, 13.7];
		    dataArray2008[5] = [8.1, 6.9, 6.4, 11.0, 12.0, 11.6, 15.7, 16.1, 11.0, 10.3, 10.8, 18.7, 14.2, 15.6, 13.8, 18.4, 16.3, 16.7, 18.5];
		    dataArray2008[6] = [21.7, 20.0, 17.8, 25.2, 19.7, 18.9, 21, 24.7, 21.1, 19.6, 16.4, 23.1, 21.1, 24.8, 20.1, 20.1, 21.4, 18.2, 19.8];
		    dataArray2008[7] = [14.6, 15.7, 14.0, 18.3, 15.7, 15.8, 18.6, 18.5, 15.9, 15.1, 14.6, 18.8, 17.1, 18.2, 16.7, 17.6, 17.2, 16.7, 19.6];
		    dataArray2008[8] = ['2/28', '3/3', '3/8', '3/13', '3/18', '3/23', '3/28', '4/3', '4/8', '4/13',
                                '4/18', '4/23', '4/28', '5/3', '5/8', '5/13', '5/18', '5/23', '5/28'];

		    //农墒2007年数据
		    var dataArray2007 = new Array();
		    dataArray2007[0] = [20.4, 8.9, 17.8, 22.8, 22.5, 22.3, 20.8, 21.9, 20.7, 24.3, 26.2, 26.2, 21.3, 18.7, 17.9, 17.8, 18.6, 25.7, 24.9, 23.5, 16.9];
		    dataArray2007[1] = [11.6, 14.8, 13.3, 14.4, 17.2, 12.4, 14.9, 14.0, 12.5, 12.0, 13.2, 12.5, 13.5, 16.3, 16, 13, 14.1, 14.4, 14.4, 12.3, 10.1];
		    dataArray2007[2] = [18.1, 17.5, 18.4, 24.2, 22.8, 17.3, 18.5, 18.4, 18.1, 18.0, 17.9, 17.9, 17.3, 16.0, 16.5, 17.6, 19, 18.5, 18.3, 16.5, 12.9];
		    dataArray2007[3] = [20.1, 21.1, 21.0, 32.2, 18.1, 24.6, 19.5, 20.2, 20.5, 20.5, 19.3, 17.7, 18.3, 17.0, 16.4, 15.6, 19.1, 19.3, 19.7, 14.1, 14.6];
		    dataArray2007[4] = [13.2, 12.1, 11.8, 13.5, 12.2, 13.2, 13.0, 13.2, 13.8, 14.4, 11.5, 12.4, 12.5, 11.6, 12.7, 12.5, 15.6, 15.9, 14.8, 10.1, 9.9];
		    dataArray2007[5] = [9.5, 11.1, 12.5, 11.1, 14.4, 13.5, 11.8, 12.5, 10.5, 11.3, 9.7, 10.6, 8.7, 9.3, 7.8, 9.3, 12.1, 13.0, 14.1, 7.8, 7];
		    dataArray2007[6] = [20.8, 21.1, 20.3, 35.3, 23.2, 19.6, 23.1, 22.1, 19.4, 24.2, 18.3, 18.0, 17.8, 13.7, 12.3, 15.7, 17.9, 18.0, 20.8, 13.3, 12.7];
		    dataArray2007[7] = [16.2, 15.2, 16.4, 21.9, 18.6, 17.6, 17.4, 17.5, 16.5, 17.8, 16.6, 16.5, 15.6, 14.7, 14.2, 14.5, 16.6, 17.8, 18.1, 13.9, 12.0];
		    dataArray2007[8] = ['2/28', '3/3', '3/8', '3/13', '3/18', '3/23', '3/28', '4/3', '4/8', '4/13',
                                 '4/18', '4/23', '4/28', '5/3', '5/8', '5/13', '5/18', '5/23', '5/28', '6/18', '6/23'];

		    //农墒2006年数据
		    var dataArray2006 = new Array();
		    dataArray2006[0] = [30.7, 26.5, 24.9, 32.2, 29.6, 28.1, 25.5, 26.6, 25.6, 25.3, 24.6, 22.9, 22.4, 22.7, 23.2, 21.5, 23.4, 21.2, 24.5];
		    dataArray2006[1] = [17.8, 15.3, 18.9, 16.2, 20.7, 15.4, 16.9, 19.4, 17.6, 17.6, 18.0, 16.6, 18.5, 18.7, 18.8, 17.2, 18.4, 15.8, 18.4];
		    dataArray2006[2] = [17.3, 17.7, 22.0, 18.5, 17.8, 17.2, 17.0, 17.8, 18.2, 17.5, 17.5, 19.3, 16.6, 16.4, 18.5, 17.5, 17.4, 17.1, 17.4];
		    dataArray2006[3] = [24.6, 34.2, 29.7, 32.2, 28.9, 26.9, 24.9, 24.6, 22.7, 20.8, 20.4, 14.4, 18.3, 20.0, 21.5, 21.0, 19.7, 19.8, 19.7];
		    dataArray2006[4] = [10.9, 11.2, 12.2, 12.5, 13.7, 13.9, 12.0, 13.9, 13.2, 12.2, 13.6, 12.0, 14.1, 13.7, 13.4, 18.8, 11.9, 14.4, 11.9];
		    dataArray2006[5] = [18.3, 9.5, 14.0, 13.1, 19.3, 12.8, 11.0, 15.0, 16.7, 14.2, 13.9, 17.0, 14.6, 15.2, 15.7, 15.3, 15.2, 15.3, 15.2];
		    dataArray2006[6] = [37.4, 36.5, 35.3, 38.0, 31.3, 27.4, 27.0, 25.0, 27.4, 20.6, 25.4, 26.4, 28.7, 23.5, 25.2, 26.0, 24.4, 21.4, 24.0];
		    dataArray2006[7] = [22.4, 21.6, 22.4, 23.2, 23.0, 20.2, 19.2, 20.3, 20.2, 18.3, 19.1, 18.4, 19.0, 18.6, 19.5, 19.6, 18.6, 17.9, 18.7];
		    dataArray2006[8] = ['2/28', '3/3', '3/8', '3/13', '3/18', '3/23', '3/28', '4/3', '4/8', '4/13', '4/18', '4/23',
                                '4/28', '5/3', '5/8', '5/13', '5/18', '5/23', '5/28'];

		    function setData(index) {
		        if (index == '2012') {
		            chart.xAxis[0].categories = null;
		            chart.xAxis[0].categories = dataArray2012[dataArray2012.length - 1];
		            for (var i = 0; i < dataArray2012.length - 1; i++) {
		                chart.series[i].setData(dataArray2012[i]);
		            }
		        }
		        if (index == '2011') {
		            chart.xAxis[0].categories = null;
		            chart.xAxis[0].categories = dataArray2011[dataArray2011.length - 1];
		            for (var i = 0; i < dataArray2011.length - 1; i++) {
		                chart.series[i].setData(dataArray2011[i]);
		            }
		        }
		        if (index == '2010') {
		            chart.xAxis[0].categories = null;
		            chart.xAxis[0].categories = dataArray2010[dataArray2010.length - 1];
		            for (var i = 0; i < dataArray2010.length - 1; i++) {
		                chart.series[i].setData(dataArray2010[i]);
		            }
		        }
		        if (index == '2009') {
		            chart.xAxis[0].categories = null;
		            chart.xAxis[0].categories = dataArray2009[dataArray2009.length - 1];
		            for (var i = 0; i < dataArray2009.length - 1; i++) {
		                chart.series[i].setData(dataArray2009[i]);
		            }
		        }
		        if (index == '2008') {
		            chart.xAxis[0].categories = null;
		            chart.xAxis[0].categories = dataArray2008[dataArray2008.length - 1];
		            for (var i = 0; i < dataArray2008.length - 1; i++) {
		                chart.series[i].setData(dataArray2008[i]);
		            }
		        }
		        if (index == '2007') {
		            chart.xAxis[0].categories = null;
		            chart.xAxis[0].categories = dataArray2007[dataArray2007.length - 1];
		            for (var i = 0; i < dataArray2007.length - 1; i++) {
		                chart.series[i].setData(dataArray2007[i]);
		            }
		        }
		        if (index == '2006') {
		            chart.xAxis[0].categories = null;
		            chart.xAxis[0].categories = dataArray2006[dataArray2006.length - 1];
		            for (var i = 0; i < dataArray2006.length - 1; i++) {
		                chart.series[i].setData(dataArray2006[i]);
		            }
		        }
		    }
		    function setArea(areastr) {
		        if (areastr == '全部') {
		            for (var i = 0; i < chart.series.length; i++) {
		                chart.series[i].show();
		            }
		        }
		        else {

		            for (var i = 0; i < chart.series.length; i++) {
		                chart.series[i].hide();
		                if (chart.series[i].name == areastr) {
		                    chart.series[i].show();
		                }
		            }
		            setData(document.getElementById("yearselect")[document.getElementById("yearselect").selectedIndex].value);
		        }
		    }
</script>
	</head>
	<body>
<script src="script/highcharts.js"></script>
<script src="script/exporting.js"></script>
<div style="text-align:center;">
    <span style="font-size:18px;FONT-FAMILY: 华文中宋;">沈阳地区墒情对照图</span>
        &nbsp;&nbsp;
        <span style="font-size:12px;">年份:<select onchange="setData(this.value);" style="font-size:12px;" id="yearselect">
        <option value='2012'  selected="selected">2012</option>
        <option value='2011'>2011</option>
        <option value='2010'>2010</option>
        <option value='2009'>2009</option>
        <option value='2008'>2008</option>
        <option value='2007'>2007</option>
        <option value='2006'>2006</option>
    </select>&nbsp;&nbsp;区县:
        <select onchange="setArea(this.value);" style="font-size:12px;" id="xianselect">
        <option value='全部' selected="selected">全部</option>
        <option value='东陵'>东陵</option>
        <option value='新民'>新民</option>
        <option value='辽中'>辽中</option>
        <option value='沈北'>沈北</option>
        <option value='康平'>康平</option>
        <option value='法库'>法库</option>
        <option value='苏家屯'>苏家屯</option>
        <option value='平均'>平均</option>
        </select>
</span>
</div>
<div id="container" style="min-width: 400px; height: 500px; margin: 0 auto"></div>
	</body>
</html>
